package demo1;

public class test {
    public static void main(String[] args) {
        Animal animal = new Dog();
        if (animal instanceof Dog) { // Dog a=new animal() FALSE
           ((Dog) animal).keepHome();
        }
        animal.eat();

        animal = new Cat();
        if (animal instanceof Cat) {
            ((Cat) animal).catchMouse();
        }
        animal.eat();
    }
}
